﻿@model IEnumerable<BudgetMealsModels.Entities.Recipe>

@{
    Layout = null;
    var summaryLength = 50;
}

@if (Model.Count() > 0)
{
    <h2>Related Recipes</h2>
    foreach (var recipe in Model)
    {
        <h3>@recipe.Name</h3>
    
        if (recipe.Summary != null)
        {
            @recipe.Summary.Substring(0, summaryLength)

            if (recipe.Summary.Length > summaryLength)
            {
                @:...
            }
        }
        else
        {
            @:No summary available for this recipe
        }
    }
}
